<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>WordPress API | RubyFu</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.2">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-anchors/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    
        <link rel="stylesheet" href="../styles/website.css">
    

        
    
    
    <link rel="next" href="../module_0x4__web_kung_fu/twitter_api.html" />
    
    
    <link rel="prev" href="../module_0x4__web_kung_fu/interacting_with_apis.html" />
    

        <script type="text/javascript" src="../styles/header.js"></script>
    </head>
    <body>
        
        
    <div class="book"
        data-level="4.5.2.1"
        data-chapter-title="WordPress API"
        data-filepath="module_0x4__web_kung_fu/wordpress_api.md"
        data-basepath=".."
        data-revision="Wed Jan 27 2016 09:00:51 GMT+0300 (AST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Module 0x0 | Introduction
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="0.1" data-path="contribution.html">
            
                
                    <a href="../contribution.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.1.</b>
                        
                        Contribution
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="0.2" data-path="beginners.html">
            
                
                    <a href="../beginners.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.2.</b>
                        
                        Beginners
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="0.3" data-path="required_gems.html">
            
                
                    <a href="../required_gems.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>0.3.</b>
                        
                        Required Gems
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1" data-path="module_0x1__basic_ruby_kung_fu/index.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        Module 0x1 | Basic Ruby Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="module_0x1__basic_ruby_kung_fu/string.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/string.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        String
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="module_0x1__basic_ruby_kung_fu/conversion.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/conversion.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.1.</b>
                        
                        Conversion
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="module_0x1__basic_ruby_kung_fu/extraction.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/extraction.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.2.</b>
                        
                        Extraction
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="module_0x1__basic_ruby_kung_fu/array.html">
            
                
                    <a href="../module_0x1__basic_ruby_kung_fu/array.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        Array
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="module_0x2__system_kung_fu/index.html">
            
                
                    <a href="../module_0x2__system_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        Module 0x2 | System Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="module_0x2__system_kung_fu/command_execution.html">
            
                
                    <a href="../module_0x2__system_kung_fu/command_execution.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        Command Execution
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="module_0x2__system_kung_fu/file_manipulation.html">
            
                
                    <a href="../module_0x2__system_kung_fu/file_manipulation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        File manipulation
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="module_0x2__system_kung_fu/parsing_html,_xml,_json.html">
            
                
                    <a href="../module_0x2__system_kung_fu/parsing_html,_xml,_json.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.1.</b>
                        
                        Parsing HTML, XML, JSON
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="module_0x2__system_kung_fu/cryptography.html">
            
                
                    <a href="../module_0x2__system_kung_fu/cryptography.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        Cryptography
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="module_0x2__system_kung_fu/system_shell.html">
            
                
                    <a href="../module_0x2__system_kung_fu/system_shell.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        Remote Shell
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="module_0x2__system_kung_fu/ncatrb.html">
            
                
                    <a href="../module_0x2__system_kung_fu/ncatrb.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.1.</b>
                        
                        Ncat.rb
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="module_0x2__system_kung_fu/rce_as_a_service.html">
            
                
                    <a href="../module_0x2__system_kung_fu/rce_as_a_service.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.2.</b>
                        
                        RCE as a Service
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="module_0x2__system_kung_fu/virustotal.html">
            
                
                    <a href="../module_0x2__system_kung_fu/virustotal.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        VirusTotal
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="module_0x3__network_kung_fu/index.html">
            
                
                    <a href="../module_0x3__network_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        Module 0x3 | Network Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="module_0x3__network_kung_fu/ruby_socket.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ruby_socket.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        Ruby Socket
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="module_0x3__network_kung_fu/ssid_finder.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ssid_finder.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        SSID Finder
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="module_0x3__network_kung_fu/ftp.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ftp.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        FTP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="module_0x3__network_kung_fu/ssh.html">
            
                
                    <a href="../module_0x3__network_kung_fu/ssh.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        SSH
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="module_0x2__system_kung_fu/email.html">
            
                
                    <a href="../module_0x2__system_kung_fu/email.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        Email
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.5.1" data-path="module_0x2__system_kung_fu/smtp_enumeration.html">
            
                
                    <a href="../module_0x2__system_kung_fu/smtp_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.1.</b>
                        
                        SMTP Enumeration
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="module_0x3__network_kung_fu/network_scanning.html">
            
                
                    <a href="../module_0x3__network_kung_fu/network_scanning.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        Network Scanning
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.6.1" data-path="module_0x3__network_kung_fu/nmap.html">
            
                
                    <a href="../module_0x3__network_kung_fu/nmap.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.1.</b>
                        
                        Nmap
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="module_0x3__network_kung_fu/dns.html">
            
                
                    <a href="../module_0x3__network_kung_fu/dns.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        DNS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.7.1" data-path="module_0x3__network_kung_fu/dns_enumeration.html">
            
                
                    <a href="../module_0x3__network_kung_fu/dns_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.1.</b>
                        
                        DNS Enumeration
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="module_0x3__network_kung_fu/snmp_enumeration.html">
            
                
                    <a href="../module_0x3__network_kung_fu/snmp_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        SNMP Enumeration
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="module_0x3__network_kung_fu/tns_enumeration.html">
            
                
                    <a href="../module_0x3__network_kung_fu/tns_enumeration.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        Oracle TNS Enumeration
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="module_0x3__network_kung_fu/packet_manipulation.html">
            
                
                    <a href="../module_0x3__network_kung_fu/packet_manipulation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        Packet manipulation
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.10.1" data-path="module_0x3__network_kung_fu/arp_spoofing.html">
            
                
                    <a href="../module_0x3__network_kung_fu/arp_spoofing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.1.</b>
                        
                        ARP Spoofing
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10.2" data-path="module_0x3__network_kung_fu/dns_spoofing.html">
            
                
                    <a href="../module_0x3__network_kung_fu/dns_spoofing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.2.</b>
                        
                        DNS Spoofing
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="module_0x4__web_kung_fu/index.html">
            
                
                    <a href="../module_0x4__web_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        Module 0x4 | Web Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="module_0x4__web_kung_fu/sql_injection_scanner.html">
            
                
                    <a href="../module_0x4__web_kung_fu/sql_injection_scanner.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        SQL Injection Scanner
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="module_0x4__web_kung_fu/databases.html">
            
                
                    <a href="../module_0x4__web_kung_fu/databases.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        Databases
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="module_0x4__web_kung_fu/extending_burpsuite.html">
            
                
                    <a href="../module_0x4__web_kung_fu/extending_burpsuite.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        Extending Burp Suite
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="module_0x4__web_kung_fu/browser_manipulation.html">
            
                
                    <a href="../module_0x4__web_kung_fu/browser_manipulation.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        Browser Manipulation
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="module_0x4__web_kung_fu/web_servcies_and_apis.html">
            
                
                    <a href="../module_0x4__web_kung_fu/web_servcies_and_apis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        Web Services and APIs
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.5.1" data-path="module_0x4__web_kung_fu/web_services.html">
            
                
                    <a href="../module_0x4__web_kung_fu/web_services.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.1.</b>
                        
                        Interacting with Web Services
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5.2" data-path="module_0x4__web_kung_fu/interacting_with_apis.html">
            
                
                    <a href="../module_0x4__web_kung_fu/interacting_with_apis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.2.</b>
                        
                        Interacting with APIs
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="4.5.2.1" data-path="module_0x4__web_kung_fu/wordpress_api.html">
            
                
                    <a href="../module_0x4__web_kung_fu/wordpress_api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.2.1.</b>
                        
                        WordPress API
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.5.2.2" data-path="module_0x4__web_kung_fu/twitter_api.html">
            
                
                    <a href="../module_0x4__web_kung_fu/twitter_api.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.2.2.</b>
                        
                        Twitter API
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="module_0x4__web_kung_fu/ruby2javascript.html">
            
                
                    <a href="../module_0x4__web_kung_fu/ruby2javascript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.6.</b>
                        
                        Ruby 2 JavaScript
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="module_0x4__web_kung_fu/web_server_and_proxy.html">
            
                
                    <a href="../module_0x4__web_kung_fu/web_server_and_proxy.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.7.</b>
                        
                        Web Server and Proxy
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="module_0x5__exploitation_kung_fu/index.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        Module 0x5 | Exploitation Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="module_0x5__exploitation_kung_fu/fuzzer.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/fuzzer.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        Fuzzer
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="module_0x5__exploitation_kung_fu/metasploit.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/metasploit.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        Metasploit
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.2.1" data-path="module_0x5__exploitation_kung_fu/auxiliary_module.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/auxiliary_module.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.1.</b>
                        
                        Auxiliary module
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.2" data-path="module_0x5__exploitation_kung_fu/exploit_module.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/exploit_module.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.2.</b>
                        
                        Exploit module
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.3" data-path="module_0x5__exploitation_kung_fu/meterpreter.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/meterpreter.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.</b>
                        
                        Meterpreter
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.2.3.1" data-path="module_0x5__exploitation_kung_fu/extensions.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/extensions.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.1.</b>
                        
                        API and Extensions
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.3.2" data-path="module_0x5__exploitation_kung_fu/meterpreter_scripting.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/meterpreter_scripting.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.2.</b>
                        
                        Meterpreter Scripting
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2.3.3" data-path="module_0x5__exploitation_kung_fu/railgun_api_extension.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/railgun_api_extension.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.3.3.</b>
                        
                        Railgun API Extension
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="module_0x5__exploitation_kung_fu/metasm.html">
            
                
                    <a href="../module_0x5__exploitation_kung_fu/metasm.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        metasm
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="module_0x6__forensic/index.html">
            
                
                    <a href="../module_0x6__forensic/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        Module 0x6 | Forensic Kung Fu
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="module_0x6__forensic/windows_forensic.html">
            
                
                    <a href="../module_0x6__forensic/windows_forensic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        Windows Forensic
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="module_0x6__forensic/android_forensic.html">
            
                
                    <a href="../module_0x6__forensic/android_forensic.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        Android Forensic
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="module_0x3__network_kung_fu/network_traffic_analysis.html">
            
                
                    <a href="../module_0x3__network_kung_fu/network_traffic_analysis.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        Network Traffic Analysis
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="module_0x6__forensic/parsing_log_files.html">
            
                
                    <a href="../module_0x6__forensic/parsing_log_files.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        Parsing Log Files
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="references/index.html">
            
                
                    <a href="../references/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        References
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="8" data-path="faqs/index.html">
            
                
                    <a href="../faqs/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>8.</b>
                        
                        FAQs
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="9" data-path="contributors/index.html">
            
                
                    <a href="../contributors/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.</b>
                        
                        Contributors
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="9.1" data-path="contributors/todo.html">
            
                
                    <a href="../contributors/todo.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>9.1.</b>
                        
                        TODO
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >RubyFu</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="wordpress-api"><a name="wordpress-api" class="plugin-anchor" href="#wordpress-api"><span class="fa fa-link"></span></a>WordPress API</h1>
<p>Ruby has a <a href="http://ruby-doc.org/stdlib-2.2.3/libdoc/xmlrpc/rdoc/XMLRPC/Client.html" target="_blank">standard library</a> called <code>xmlrpc</code> which takes care of all xmlrpc stuff, you can even create an XML-RPC server using it. Let&apos;s to get some real word example </p>
<p>Looking for really known application that support XML-RPC then of course WordPress was the first attendee. </p>
<p>So what do we want to do?</p>
<ul>
<li>Say hello to WordPress </li>
<li>List all available methods</li>
<li>List all available users</li>
<li>List all available post</li>
<li>Create a new post!</li>
<li>Retrieve our created post</li>
<li>List all comments on our created post</li>
</ul>
<pre><code class="lang-ruby"><span class="hljs-keyword">require</span> <span class="hljs-string">&apos;xmlrpc/client&apos;</span>

opts =
    {
        <span class="hljs-symbol">host:</span> <span class="hljs-string">&apos;172.17.0.2&apos;</span>,
        <span class="hljs-symbol">path:</span> <span class="hljs-string">&apos;/xmlrpc.php&apos;</span>,
        <span class="hljs-symbol">port:</span> <span class="hljs-number">80</span>,
        <span class="hljs-symbol">proxy_host:</span> <span class="hljs-keyword">nil</span>,
        <span class="hljs-symbol">proxy_port:</span> <span class="hljs-keyword">nil</span>,
        <span class="hljs-symbol">user:</span> <span class="hljs-string">&apos;admin&apos;</span>,
        <span class="hljs-symbol">password:</span> <span class="hljs-string">&apos;123123&apos;</span>,
        <span class="hljs-symbol">use_ssl:</span> <span class="hljs-keyword">false</span>,
        <span class="hljs-symbol">timeout:</span> <span class="hljs-number">30</span>
    }

<span class="hljs-comment"># Create a new instance </span>
server = <span class="hljs-constant">XMLRPC::Client</span>.new(
    opts[<span class="hljs-symbol">:host</span>], opts[<span class="hljs-symbol">:path</span>], opts[<span class="hljs-symbol">:port</span>],
    opts[<span class="hljs-symbol">:proxy_host</span>], opts[<span class="hljs-symbol">:proxy_port</span>],
    opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>],
    opts[<span class="hljs-symbol">:use_ssl</span>], opts[<span class="hljs-symbol">:timeout</span>]
)

<span class="hljs-comment"># Create a new instance takes a hash</span>
server = <span class="hljs-constant">XMLRPC::Client</span>.new3(opts)

<span class="hljs-comment"># Say hello to WordPress</span>
response = server.call(<span class="hljs-string">&quot;demo.sayHello&quot;</span>)

<span class="hljs-comment"># List all available methods</span>
server.call(<span class="hljs-string">&apos;system.listMethods&apos;</span>, <span class="hljs-number">0</span>)

<span class="hljs-comment"># List all available users</span>
server.call(<span class="hljs-string">&apos;wp.getAuthors&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>])

<span class="hljs-comment"># List all available post</span>
response = server.call(<span class="hljs-string">&apos;wp.getPosts&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>])

<span class="hljs-comment"># Create a new post!</span>
post =
    {
        <span class="hljs-string">&quot;post_title&quot;</span>     =&gt; <span class="hljs-string">&apos;Rubyfu vs WP XML-RPC&apos;</span>,
        <span class="hljs-string">&quot;post_name&quot;</span>      =&gt; <span class="hljs-string">&apos;Rubyfu vs WordPress XML-RPC&apos;</span>,
        <span class="hljs-string">&quot;post_content&quot;</span>   =&gt; <span class="hljs-string">&apos;This is Pragmatic Rubyfu Post. Thanks for reading&apos;</span>,
        <span class="hljs-string">&quot;post_author&quot;</span>    =&gt; <span class="hljs-number">2</span>,
        <span class="hljs-string">&quot;post_status&quot;</span>    =&gt; <span class="hljs-string">&apos;publish&apos;</span>,
        <span class="hljs-string">&quot;comment_status&quot;</span> =&gt; <span class="hljs-string">&apos;open&apos;</span>
    }
response = server.call(<span class="hljs-string">&quot;wp.newPost&quot;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>], post)

<span class="hljs-comment"># Retrieve created post</span>
response =  server.call(<span class="hljs-string">&apos;wp.getPosts&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>], {<span class="hljs-string">&quot;post_type&quot;</span> =&gt; <span class="hljs-string">&quot;post&quot;</span>, <span class="hljs-string">&quot;post_status&quot;</span> =&gt; <span class="hljs-string">&quot;published&quot;</span>, <span class="hljs-string">&quot;number&quot;</span> =&gt; <span class="hljs-string">&quot;2&quot;</span>, <span class="hljs-string">&quot;offset&quot;</span> =&gt; <span class="hljs-string">&quot;2&quot;</span>})

<span class="hljs-comment"># List all comments on a specific post</span>
response =  server.call(<span class="hljs-string">&apos;wp.getComments&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>], {<span class="hljs-string">&quot;post_id&quot;</span> =&gt; <span class="hljs-number">4</span>})
</code></pre>
<p>Results </p>
<pre><code class="lang-ruby"><span class="hljs-prompt">&gt;&gt;</span> <span class="hljs-comment"># Say hello to WordPress</span>
<span class="hljs-prompt">&gt;&gt;</span> response = server.call(<span class="hljs-string">&quot;demo.sayHello&quot;</span>)
<span class="hljs-status">=&gt;</span> <span class="hljs-string">&quot;Hello!&quot;</span>
<span class="hljs-prompt">&gt;&gt;</span> 
<span class="hljs-prompt">&gt;&gt;</span> <span class="hljs-comment"># List all available methods</span>
<span class="hljs-prompt">&gt;&gt;</span> server.call(<span class="hljs-string">&apos;system.listMethods&apos;</span>, <span class="hljs-number">0</span>)
<span class="hljs-status">=&gt;</span> [<span class="hljs-string">&quot;system.multicall&quot;</span>,
 <span class="hljs-string">&quot;system.listMethods&quot;</span>,
 <span class="hljs-string">&quot;system.getCapabilities&quot;</span>,
 <span class="hljs-string">&quot;demo.addTwoNumbers&quot;</span>,
 <span class="hljs-string">&quot;demo.sayHello&quot;</span>,
 <span class="hljs-string">&quot;pingback.extensions.getPingbacks&quot;</span>,
 <span class="hljs-string">&quot;pingback.ping&quot;</span>,
 <span class="hljs-string">&quot;mt.publishPost&quot;</span>,
 <span class="hljs-string">&quot;mt.getTrackbackPings&quot;</span>,
 <span class="hljs-string">&quot;mt.supportedTextFilters&quot;</span>,
 ...skipping...
 <span class="hljs-string">&quot;metaWeblog.newMediaObject&quot;</span>,
 <span class="hljs-string">&quot;metaWeblog.getCategories&quot;</span>,
 <span class="hljs-string">&quot;metaWeblog.getRecentPosts&quot;</span>,
 <span class="hljs-string">&quot;metaWeblog.getPost&quot;</span>,
 <span class="hljs-string">&quot;metaWeblog.editPost&quot;</span>,
 <span class="hljs-string">&quot;metaWeblog.newPost&quot;</span>,
 ...skipping...
 <span class="hljs-string">&quot;blogger.deletePost&quot;</span>,
 <span class="hljs-string">&quot;blogger.editPost&quot;</span>,
 <span class="hljs-string">&quot;blogger.newPost&quot;</span>,
 <span class="hljs-string">&quot;blogger.getRecentPosts&quot;</span>,
 <span class="hljs-string">&quot;blogger.getPost&quot;</span>,
 <span class="hljs-string">&quot;blogger.getUserInfo&quot;</span>,
 <span class="hljs-string">&quot;blogger.getUsersBlogs&quot;</span>,
 <span class="hljs-string">&quot;wp.restoreRevision&quot;</span>,
 <span class="hljs-string">&quot;wp.getRevisions&quot;</span>,
 <span class="hljs-string">&quot;wp.getPostTypes&quot;</span>,
 <span class="hljs-string">&quot;wp.getPostType&quot;</span>,
 ...skipping...
 <span class="hljs-string">&quot;wp.getPost&quot;</span>,
 <span class="hljs-string">&quot;wp.deletePost&quot;</span>,
 <span class="hljs-string">&quot;wp.editPost&quot;</span>,
 <span class="hljs-string">&quot;wp.newPost&quot;</span>,
 <span class="hljs-string">&quot;wp.getUsersBlogs&quot;</span>]
<span class="hljs-prompt">&gt;&gt;</span> 
<span class="hljs-prompt">&gt;&gt;</span> <span class="hljs-comment"># List all available users</span>
<span class="hljs-prompt">&gt;&gt;</span> server.call(<span class="hljs-string">&apos;wp.getAuthors&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>])
<span class="hljs-status">=&gt;</span> [{<span class="hljs-string">&quot;user_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;user_login&quot;</span>=&gt;<span class="hljs-string">&quot;admin&quot;</span>, <span class="hljs-string">&quot;display_name&quot;</span>=&gt;<span class="hljs-string">&quot;admin&quot;</span>}, {<span class="hljs-string">&quot;user_id&quot;</span>=&gt;<span class="hljs-string">&quot;3&quot;</span>, <span class="hljs-string">&quot;user_login&quot;</span>=&gt;<span class="hljs-string">&quot;galaxy&quot;</span>, <span class="hljs-string">&quot;display_name&quot;</span>=&gt;<span class="hljs-string">&quot;Galaxy&quot;</span>}, {<span class="hljs-string">&quot;user_id&quot;</span>=&gt;<span class="hljs-string">&quot;2&quot;</span>, <span class="hljs-string">&quot;user_login&quot;</span>=&gt;<span class="hljs-string">&quot;Rubyfu&quot;</span>, <span class="hljs-string">&quot;display_name&quot;</span>=&gt;<span class="hljs-string">&quot;Rubyfu&quot;</span>}]
<span class="hljs-prompt">&gt;&gt;</span> 
<span class="hljs-prompt">&gt;&gt;</span> <span class="hljs-comment"># List all available post</span>
<span class="hljs-prompt">&gt;&gt;</span> response = server.call(<span class="hljs-string">&apos;wp.getPosts&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>])
<span class="hljs-status">=&gt;</span> [{<span class="hljs-string">&quot;post_id&quot;</span>=&gt;<span class="hljs-string">&quot;4&quot;</span>,
  <span class="hljs-string">&quot;post_title&quot;</span>=&gt;<span class="hljs-string">&quot;Rubyfu vs WP XMLRPC&quot;</span>,
  <span class="hljs-string">&quot;post_date&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x0000000227f3b0 @day=1, @hour=19, @min=44, @month=11, @sec=31, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_date_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x0000000227d178 @day=1, @hour=19, @min=44, @month=11, @sec=31, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000021d6ee0 @day=1, @hour=19, @min=52, @month=11, @sec=25, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000021d4ca8 @day=1, @hour=19, @min=52, @month=11, @sec=25, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_status&quot;</span>=&gt;<span class="hljs-string">&quot;publish&quot;</span>,
  <span class="hljs-string">&quot;post_type&quot;</span>=&gt;<span class="hljs-string">&quot;post&quot;</span>,
  <span class="hljs-string">&quot;post_name&quot;</span>=&gt;<span class="hljs-string">&quot;rubyfu-vs-wordpress-xmlrpc&quot;</span>,
  <span class="hljs-string">&quot;post_author&quot;</span>=&gt;<span class="hljs-string">&quot;2&quot;</span>,
  <span class="hljs-string">&quot;post_password&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_excerpt&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_content&quot;</span>=&gt;<span class="hljs-string">&quot;This is Pragmatic Rubyfu Post. Thanks for reading&quot;</span>,
  <span class="hljs-string">&quot;post_parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>,
  <span class="hljs-string">&quot;post_mime_type&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;link&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/2015/11/01/rubyfu-vs-wordpress-xmlrpc/&quot;</span>,
  <span class="hljs-string">&quot;guid&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/?p=4&quot;</span>,
  <span class="hljs-string">&quot;menu_order&quot;</span>=&gt;<span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;comment_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;ping_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;sticky&quot;</span>=&gt;false,
  <span class="hljs-string">&quot;post_thumbnail&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;post_format&quot;</span>=&gt;<span class="hljs-string">&quot;standard&quot;</span>,
  <span class="hljs-string">&quot;terms&quot;</span>=&gt;
   [{<span class="hljs-string">&quot;term_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;name&quot;</span>=&gt;<span class="hljs-string">&quot;Uncategorized&quot;</span>, <span class="hljs-string">&quot;slug&quot;</span>=&gt;<span class="hljs-string">&quot;uncategorized&quot;</span>, <span class="hljs-string">&quot;term_group&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;term_taxonomy_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;taxonomy&quot;</span>=&gt;<span class="hljs-string">&quot;category&quot;</span>, <span class="hljs-string">&quot;description&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;count&quot;</span>=&gt;<span class="hljs-number">2</span>, <span class="hljs-string">&quot;filter&quot;</span>=&gt;<span class="hljs-string">&quot;raw&quot;</span>}],
  <span class="hljs-string">&quot;custom_fields&quot;</span>=&gt;[]},
 {<span class="hljs-string">&quot;post_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_title&quot;</span>=&gt;<span class="hljs-string">&quot;Hello world!&quot;</span>,
  <span class="hljs-string">&quot;post_date&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002735580 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_date_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x0000000226b130 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002268de0 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000021aea58 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_status&quot;</span>=&gt;<span class="hljs-string">&quot;publish&quot;</span>,
  <span class="hljs-string">&quot;post_type&quot;</span>=&gt;<span class="hljs-string">&quot;post&quot;</span>,
  <span class="hljs-string">&quot;post_name&quot;</span>=&gt;<span class="hljs-string">&quot;hello-world&quot;</span>,
  <span class="hljs-string">&quot;post_author&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_password&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_excerpt&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_content&quot;</span>=&gt;<span class="hljs-string">&quot;Welcome to WordPress. This is your first post. Edit or delete it, then start writing!&quot;</span>,
  <span class="hljs-string">&quot;post_parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>,
  <span class="hljs-string">&quot;post_mime_type&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;link&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/2015/11/01/hello-world/&quot;</span>,
  <span class="hljs-string">&quot;guid&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/?p=1&quot;</span>,
  <span class="hljs-string">&quot;menu_order&quot;</span>=&gt;<span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;comment_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;ping_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;sticky&quot;</span>=&gt;false,
  <span class="hljs-string">&quot;post_thumbnail&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;post_format&quot;</span>=&gt;<span class="hljs-string">&quot;standard&quot;</span>,
  <span class="hljs-string">&quot;terms&quot;</span>=&gt;
   [{<span class="hljs-string">&quot;term_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;name&quot;</span>=&gt;<span class="hljs-string">&quot;Uncategorized&quot;</span>, <span class="hljs-string">&quot;slug&quot;</span>=&gt;<span class="hljs-string">&quot;uncategorized&quot;</span>, <span class="hljs-string">&quot;term_group&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;term_taxonomy_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;taxonomy&quot;</span>=&gt;<span class="hljs-string">&quot;category&quot;</span>, <span class="hljs-string">&quot;description&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;count&quot;</span>=&gt;<span class="hljs-number">2</span>, <span class="hljs-string">&quot;filter&quot;</span>=&gt;<span class="hljs-string">&quot;raw&quot;</span>}],
  <span class="hljs-string">&quot;custom_fields&quot;</span>=&gt;[]}]
<span class="hljs-prompt">&gt;&gt;</span> 
<span class="hljs-prompt">&gt;&gt;</span> <span class="hljs-comment"># Create a new post!</span>
<span class="hljs-prompt">&gt;&gt;</span> post =
 | {    
 |   <span class="hljs-string">&quot;post_title&quot;</span>     =&gt; <span class="hljs-string">&apos;Rubyfu vs WP XML-RPC&apos;</span>,        
 |   <span class="hljs-string">&quot;post_name&quot;</span>      =&gt; <span class="hljs-string">&apos;Rubyfu vs WordPress XML-RPC&apos;</span>,        
 |   <span class="hljs-string">&quot;post_content&quot;</span>   =&gt; <span class="hljs-string">&apos;This is Pragmatic Rubyfu Post. Thanks for reading&apos;</span>,        
 |   <span class="hljs-string">&quot;post_author&quot;</span>    =&gt; <span class="hljs-number">2</span>,        
 |   <span class="hljs-string">&quot;post_status&quot;</span>    =&gt; <span class="hljs-string">&apos;publish&apos;</span>,        
 |   <span class="hljs-string">&quot;comment_status&quot;</span> =&gt; <span class="hljs-string">&apos;open&apos;</span>        
 | }      
<span class="hljs-status">=&gt;</span> {<span class="hljs-string">&quot;post_title&quot;</span>=&gt;<span class="hljs-string">&quot;Rubyfu vs WP XML-RPC&quot;</span>,
 <span class="hljs-string">&quot;post_name&quot;</span>=&gt;<span class="hljs-string">&quot;Rubyfu vs WordPress XML-RPC&quot;</span>,
 <span class="hljs-string">&quot;post_content&quot;</span>=&gt;<span class="hljs-string">&quot;This is Pragmatic Rubyfu Post. Thanks for reading&quot;</span>,
 <span class="hljs-string">&quot;post_author&quot;</span>=&gt;<span class="hljs-number">2</span>,
 <span class="hljs-string">&quot;post_status&quot;</span>=&gt;<span class="hljs-string">&quot;publish&quot;</span>,
 <span class="hljs-string">&quot;comment_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>}
<span class="hljs-prompt">&gt;&gt;</span> response = server.call(<span class="hljs-string">&quot;wp.newPost&quot;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>], post)
<span class="hljs-status">=&gt;</span> <span class="hljs-string">&quot;7&quot;</span>
<span class="hljs-prompt">&gt;&gt;</span> <span class="hljs-comment"># Retrieve created post</span>
<span class="hljs-prompt">&gt;&gt;</span> response =  server.call(<span class="hljs-string">&apos;wp.getPosts&apos;</span>, <span class="hljs-number">0</span>, opts[<span class="hljs-symbol">:user</span>], opts[<span class="hljs-symbol">:password</span>], {<span class="hljs-string">&quot;post_type&quot;</span> =&gt; <span class="hljs-string">&quot;post&quot;</span>, <span class="hljs-string">&quot;post_status&quot;</span> =&gt; <span class="hljs-string">&quot;published&quot;</span>, <span class="hljs-string">&quot;number&quot;</span> =&gt; <span class="hljs-string">&quot;2&quot;</span>, <span class="hljs-string">&quot;offset&quot;</span> =&gt; <span class="hljs-string">&quot;2&quot;</span>})
<span class="hljs-status">=&gt;</span> [{<span class="hljs-string">&quot;post_id&quot;</span>=&gt;<span class="hljs-string">&quot;3&quot;</span>,
  <span class="hljs-string">&quot;post_title&quot;</span>=&gt;<span class="hljs-string">&quot;Auto Draft&quot;</span>,
  <span class="hljs-string">&quot;post_date&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x0000000225bcd0 @day=1, @hour=19, @min=22, @month=11, @sec=29, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_date_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002259a98 @day=1, @hour=19, @min=22, @month=11, @sec=29, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x0000000256b808 @day=1, @hour=19, @min=22, @month=11, @sec=29, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000025695d0 @day=1, @hour=19, @min=22, @month=11, @sec=29, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_status&quot;</span>=&gt;<span class="hljs-string">&quot;auto-draft&quot;</span>,
  <span class="hljs-string">&quot;post_type&quot;</span>=&gt;<span class="hljs-string">&quot;post&quot;</span>,
  <span class="hljs-string">&quot;post_name&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_author&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_password&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_excerpt&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_content&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>,
  <span class="hljs-string">&quot;post_mime_type&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;link&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/?p=3&quot;</span>,
  <span class="hljs-string">&quot;guid&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/?p=3&quot;</span>,
  <span class="hljs-string">&quot;menu_order&quot;</span>=&gt;<span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;comment_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;ping_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;sticky&quot;</span>=&gt;false,
  <span class="hljs-string">&quot;post_thumbnail&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;post_format&quot;</span>=&gt;<span class="hljs-string">&quot;standard&quot;</span>,
  <span class="hljs-string">&quot;terms&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;custom_fields&quot;</span>=&gt;[]},
 {<span class="hljs-string">&quot;post_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_title&quot;</span>=&gt;<span class="hljs-string">&quot;Hello world!&quot;</span>,
  <span class="hljs-string">&quot;post_date&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002617298 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_date_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002615038 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000025e6d28 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000025e4aa0 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_status&quot;</span>=&gt;<span class="hljs-string">&quot;publish&quot;</span>,
  <span class="hljs-string">&quot;post_type&quot;</span>=&gt;<span class="hljs-string">&quot;post&quot;</span>,
  <span class="hljs-string">&quot;post_name&quot;</span>=&gt;<span class="hljs-string">&quot;hello-world&quot;</span>,
  <span class="hljs-string">&quot;post_author&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_password&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_excerpt&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_content&quot;</span>=&gt;<span class="hljs-string">&quot;Welcome to WordPress. This is your first post. Edit or delete it, then start writing!&quot;</span>,
  <span class="hljs-string">&quot;post_parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>,
  <span class="hljs-string">&quot;post_mime_type&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;link&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/2015/11/01/hello-world/&quot;</span>,
  <span class="hljs-string">&quot;guid&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/?p=1&quot;</span>,
  <span class="hljs-string">&quot;menu_order&quot;</span>=&gt;<span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;comment_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;ping_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;sticky&quot;</span>=&gt;false,
  <span class="hljs-string">&quot;post_thumbnail&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;post_format&quot;</span>=&gt;<span class="hljs-string">&quot;standard&quot;</span>,
  <span class="hljs-string">&quot;terms&quot;</span>=&gt;
   [{<span class="hljs-string">&quot;term_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;name&quot;</span>=&gt;<span class="hljs-string">&quot;Uncategorized&quot;</span>, <span class="hljs-string">&quot;slug&quot;</span>=&gt;<span class="hljs-string">&quot;uncategorized&quot;</span>, <span class="hljs-string">&quot;term_group&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;term_taxonomy_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;taxonomy&quot;</span>=&gt;<span class="hljs-string">&quot;category&quot;</span>, <span class="hljs-string">&quot;description&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;count&quot;</span>=&gt;<span class="hljs-number">3</span>, <span class="hljs-string">&quot;filter&quot;</span>=&gt;<span class="hljs-string">&quot;raw&quot;</span>}],
  <span class="hljs-string">&quot;custom_fields&quot;</span>=&gt;[]}]
...skipping...
  <span class="hljs-string">&quot;post_format&quot;</span>=&gt;<span class="hljs-string">&quot;standard&quot;</span>,
  <span class="hljs-string">&quot;terms&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;custom_fields&quot;</span>=&gt;[]},
 {<span class="hljs-string">&quot;post_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_title&quot;</span>=&gt;<span class="hljs-string">&quot;Hello world!&quot;</span>,
  <span class="hljs-string">&quot;post_date&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002617298 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_date_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x00000002615038 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000025e6d28 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_modified_gmt&quot;</span>=&gt;<span class="hljs-value">#&lt;XMLRPC::DateTime:0x000000025e4aa0 @day=1, @hour=17, @min=54, @month=11, @sec=14, @year=2015&gt;</span>,
  <span class="hljs-string">&quot;post_status&quot;</span>=&gt;<span class="hljs-string">&quot;publish&quot;</span>,
  <span class="hljs-string">&quot;post_type&quot;</span>=&gt;<span class="hljs-string">&quot;post&quot;</span>,
  <span class="hljs-string">&quot;post_name&quot;</span>=&gt;<span class="hljs-string">&quot;hello-world&quot;</span>,
  <span class="hljs-string">&quot;post_author&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>,
  <span class="hljs-string">&quot;post_password&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_excerpt&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;post_content&quot;</span>=&gt;<span class="hljs-string">&quot;Welcome to WordPress. This is your first post. Edit or delete it, then start writing!&quot;</span>,
  <span class="hljs-string">&quot;post_parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>,
  <span class="hljs-string">&quot;post_mime_type&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>,
  <span class="hljs-string">&quot;link&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/2015/11/01/hello-world/&quot;</span>,
  <span class="hljs-string">&quot;guid&quot;</span>=&gt;<span class="hljs-string">&quot;http://172.17.0.2/?p=1&quot;</span>,
  <span class="hljs-string">&quot;menu_order&quot;</span>=&gt;<span class="hljs-number">0</span>,
  <span class="hljs-string">&quot;comment_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;ping_status&quot;</span>=&gt;<span class="hljs-string">&quot;open&quot;</span>,
  <span class="hljs-string">&quot;sticky&quot;</span>=&gt;<span class="hljs-keyword">false</span>,
  <span class="hljs-string">&quot;post_thumbnail&quot;</span>=&gt;[],
  <span class="hljs-string">&quot;post_format&quot;</span>=&gt;<span class="hljs-string">&quot;standard&quot;</span>,
  <span class="hljs-string">&quot;terms&quot;</span>=&gt;
   [{<span class="hljs-string">&quot;term_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;name&quot;</span>=&gt;<span class="hljs-string">&quot;Uncategorized&quot;</span>, <span class="hljs-string">&quot;slug&quot;</span>=&gt;<span class="hljs-string">&quot;uncategorized&quot;</span>, <span class="hljs-string">&quot;term_group&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;term_taxonomy_id&quot;</span>=&gt;<span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;taxonomy&quot;</span>=&gt;<span class="hljs-string">&quot;category&quot;</span>, <span class="hljs-string">&quot;description&quot;</span>=&gt;<span class="hljs-string">&quot;&quot;</span>, <span class="hljs-string">&quot;parent&quot;</span>=&gt;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;count&quot;</span>=&gt;<span class="hljs-number">3</span>, <span class="hljs-string">&quot;filter&quot;</span>=&gt;<span class="hljs-string">&quot;raw&quot;</span>}],
  <span class="hljs-string">&quot;custom_fields&quot;</span>=&gt;[]}]
</code></pre>
<p>and here is the new post
<img src="webfu__xmlrpc1.png" alt=""></p>
<p>Source: <a href="http://notes.jerzygangi.com/how-to-programatically-control-wordpress-with-ruby-using-xml-rpc/" target="_blank">HOW TO PROGRAMATICALLY CONTROL WORDPRESS WITH RUBY USING XML-RPC</a></p>
<p>More about <a href="http://notes.jerzygangi.com/how-to-programatically-control-wordpress-with-ruby-using-xml-rpc/" target="_blank">WordPress XML-RPC</a></p>
<h2 id=""><a name="" class="plugin-anchor" href="#"><span class="fa fa-link"></span></a><br><br><br></h2>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../module_0x4__web_kung_fu/interacting_with_apis.html" class="navigation navigation-prev " aria-label="Previous page: Interacting with APIs"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../module_0x4__web_kung_fu/twitter_api.html" class="navigation navigation-next " aria-label="Next page: Twitter API"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-book-summary-scroll-position-saver/book-summary-scroll-position-saver.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"addcssjs":{"js":["styles/header.js"]},"anchors":{},"todo":{},"splitter":{},"book-summary-scroll-position-saver":{},"expandable-chapters":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
